<?php
$juice = "apple";

echo "He drank some $juice juice.".'<br>';
// Invalid. "s" is a valid character for a variable name, but the variable is $juice.
echo "He drank some juice made of {$juice}s.".'<br>';

$juices = array("apple", "orange", "koolaid1" => "purple");

echo "He drank some $juices[0] juice.".'<br>';
echo "He drank some $juices[1] juice.".'<br>';
echo "He drank some juice made of {$juice}s.".'<br>'; // Won't work
echo "He drank some $juices[koolaid1] juice.".'<br>';

class people {
    public $john = "John Smith";
    public $jane = "Jane Smith";
    public $robert = "Robert Paulsen";
    
    public $smith = "Smith";
}

$people = new people();

echo "$people->john drank some $juices[0] juice.".'<br>';
echo "$people->john then said hello to $people->jane.".'<br>';
echo "$people->john's wife greeted $people->robert.".'<br>';
echo "$people->robert greeted the two {$people->smith}s."; // Won't work
?>